package core.org.akaza.openclinica.domain.datamap;
//default package

//Generated Jul 31, 2013 2:03:33 PM by Hibernate Tools 3.4.0.CR1

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import core.org.akaza.openclinica.domain.DataMapDomainObject;

/**
 * VersioningMap generated by hbm2java
 */
@Entity
@Table(name = "versioning_map")
public class VersioningMap extends DataMapDomainObject {

    private VersioningMapId versionMapId;
    private CrfVersion crfVersion;
    private FormLayout formLayout;
    private Item item;
    private int itemInFormLayout;

    public VersioningMap() {
    }

    public VersioningMap(VersioningMapId id) {
        this.versionMapId = id;
    }

    public VersioningMap(VersioningMapId id, CrfVersion crfVersion, Item item, FormLayout formLayout, int itemInFormLayout) {
        this.versionMapId = id;
        this.crfVersion = crfVersion;
        this.item = item;
        this.formLayout = formLayout;
        this.itemInFormLayout = itemInFormLayout;
    }

    @EmbeddedId
    @AttributeOverrides({ @AttributeOverride(name = "crfVersionId", column = @Column(name = "crf_version_id")),
            @AttributeOverride(name = "itemId", column = @Column(name = "item_id")),
            @AttributeOverride(name = "formLayoutId", column = @Column(name = "form_layout_id")),
            @AttributeOverride(name = "itemOrderInForm", column = @Column(name = "item_order_in_form")) })

    public VersioningMapId getVersionMapId() {
        return this.versionMapId;
    }

    public void setVersionMapId(VersioningMapId id) {
        this.versionMapId = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "crf_version_id", insertable = false, updatable = false)
    public CrfVersion getCrfVersion() {
        return this.crfVersion;
    }

    public void setCrfVersion(CrfVersion crfVersion) {
        this.crfVersion = crfVersion;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "item_id", insertable = false, updatable = false)
    public Item getItem() {
        return this.item;
    }

    public void setItem(Item item) {
        this.item = item;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "form_layout_id", insertable = false, updatable = false)
    public FormLayout getFormLayout() {
        return formLayout;
    }

    public void setFormLayout(FormLayout formLayout) {
        this.formLayout = formLayout;
    }

    @Column(name = "item_order_in_form", insertable = false, updatable = false)
    public int getItemInFormLayout() {
        return itemInFormLayout;
    }

    public void setItemInFormLayout(int itemInFormLayout) {
        this.itemInFormLayout = itemInFormLayout;
    }

}
